﻿// 选中按钮
Vue.component('select-btns-component', {
    template: '<a class="btn" @click="select_(item.value)" v-bind:class="{\'active\':this.select_btn==item.value}" v-if="item!=-1"  v-for="item in btns">{!item.name!}</a>  ',
    data: function () {
        return {
            select_btn:1,//选中按钮
            btns: null,
        }
    },
    events: {
        'select_btns_init': function (msg) {
            this.btns = msg.btns;
            this.select_btn=1;
        },
    },
    methods:{
        select_:function(btn){
            this.btn_change(btn)
        },
        btn_change:function (btn){
            this.select_btn = btn;
            this.$dispatch('select_btn_change', { select_btn: btn })
        }
    }
});
